[SUBROUTINE]
version = 1.14
icon = polyline-mirror-items.png
name = _("Mirror Items")
type = poly_mirror_itms
help = _("<b>Duplicate and reverse polyline items</b>")
order = act h3 cs cr rev h2 dir arc_h h1 x1 y1 x2 y2 show

[PARAM_ACT]
name = _("Active")
icon = enable.png
type = bool
value = 0

[PARAM_H1]
name = _("Mirror line")
type = sub-header

[PARAM_H3]
name = _("Link")
type = sub-header
tool_tip = _("Link style with previous item")

[PARAM_H2]
name = _("Connection")
type = sub-header

[PARAM_CS]
name = _("Type")
header = h3
type = combo
options = _("None=0:Rounded=1:Beveled=2:Inverted Round=3")
icon = corner-style.png
tool_tip = _("Select link type")
value = 0

[PARAM_CR]
name = _("Radius")
header = h3
type = float
minimum_value = 0.0
icon = corner-radius.png
tool_tip = _("Radius for rounded or distance from apex")
value = 0.3
metric_value = 6

[PARAM_REV]
name = _("Complement")
icon = complement.png
type = bool
header = h3
tool_tip = _("Reverse direction of tool path for rounded or inverted round")
value = 0

[PARAM_X1]
name = _("X1")
header = h1
type = float
icon = x.png
tool_tip = _("Line start")
value = 0.0
metric_value = 0.0

[PARAM_Y1]
name = _("Y1")
header = h1
type = float
icon = y.png
tool_tip = _("Line start")
value = 0
metric_value = 0.0

[PARAM_X2]
name = _("X2")
header = h1
type = float
icon = x.png
tool_tip = _("Line end")
value = 1.0
metric_value = 25.0

[PARAM_Y2]
name = _("Y2")
header = h1
type = float
icon = y.png
tool_tip = _("Line end")
value = 0.0
metric_value = 0.0

[PARAM_SHOW]
name = _("Show line")
type = bool
icon = glasses.png
value = 1
header = h1
tool_tip = _("Show mirror line")

[PARAM_DIR]
name = _("Type")
header = h2
type = combo
options = _("Straight line=1:Arc clockwise=2:Arc counter-clockwise=3")
icon = cw-ccw.png
;tool_tip = Connection
value = 1

[PARAM_ARC_H]
name = _("Arc height")
type = float
icon = line-len.png
header = h2
value = 1
metric_value = 25
minimum_value = 0
not_allowed = 0

[CALL]
content =
	(begin #sub_name)
	(mirror polyline items author : Fernand Veilleux)
	
	o<#self_id_active> if [#<in_polyline> AND #param_act AND [#5000 GE 1] AND [[[#param_x1] NE [#param_x2]] OR [[#param_y1] NE [#param_y2]]]]
	/	o<#self_id0> if [#param_show]
	/		G0 X[#param_x1] Y[#param_y1] Z#<surface>
	/		G1 X[#param_x2] Y[#param_y2]
	/	o<#self_id0> endif
	
		o<poly_add_item> CALL [-2] [#param_x1] [#param_y1] [#param_dir] [#param_cs] [#param_cr] [#param_rev] [#<poly_global_engagement>] [#param_x2] [#param_y2] [#param_arc_h]
		
	o<#self_id_active> endif
	(end #sub_name)
